Retrofitting unit tests
Abstract
In this paper we describe techniques that we have found helpful for adding unit tests to existing code that has been written without tests. The paper presents some common coding practices that make unit tests hard to retrofit, and why. For each practice we suggest minimal refactorings to open up the code for testing.
See also
- Working effectively with legacy code